<template>
  <el-card>
    <h1 class="title">发布新课程</h1>
    <el-steps
      :active="active"
      process-status="wait"
      finish-status="success"
      style="margin-bottom: 40px"
    >
      <el-step title="填写课程基本信息" />
      <el-step title="创建课程大纲" />
      <el-step title="最终发布" />
    </el-steps>
    <el-form label-width="120px">
      <el-form-item label="课程标题">
        <el-input
          placeholder=" 示例：机器学习项目课：从基础到搭建项目视频课程。专业名称注意大小写"
        />
      </el-form-item>

      <!-- 所属分类 TODO -->
      <!-- 所属分类 TODO -->
      <el-form-item label="课程分类">
        <el-select placeholder="一级分类">
          <el-option />
        </el-select>

        <!-- 二级分类 -->
        <el-select placeholder="二级分类" style="margin-left: 5px">
          <el-option />
        </el-select>
      </el-form-item>

      <!-- 课程讲师 TODO -->

      <el-form-item label="课程讲师">
        <el-select placeholder="请选择">
          <el-option />
        </el-select>
      </el-form-item>

      <el-form-item label="总课时">
        <el-input-number />
      </el-form-item>

      <!-- 课程简介 TODO -->
      <!-- 课程简介-->
      <el-form-item label="课程简介"></el-form-item>

      <!-- 课程封面 TODO -->
      <el-form-item label="课程封面">
        <el-upload></el-upload>
      </el-form-item>

      <el-form-item label="课程价格"> <el-input-number />元 </el-form-item>

      <el-form-item>
        <el-button type="primary" @click="next">保存并下一步</el-button>
      </el-form-item>
    </el-form>
  </el-card>
</template>

<script lang="ts" setup>
import { ref } from 'vue'
import { useRouter } from 'vue-router'

let $router = useRouter()

// console.log($router)
const active = ref(1)

const next = () => {
  if (active.value++ > 2) active.value = 0
  $router.push({
    path: '/course/chapter/1'
  })
  console.log(active.value)
}
</script>
<style>
.title {
  text-align: center;
  margin-bottom: 16px;
  font-weight: bold;
  font-size: large;
}
</style>
